/*
 * Copyright (c) 2025 Industrial Software Feature Database
 */
package com.comac.ins.cax.service.strategy.impl;

import com.comac.ins.cax.service.strategy.ConversionStrategy;
import com.comac.ins.cax.utils.FileUtils;

import java.io.File;
import java.io.IOException;

/**
 * @author yk
 * @desc CAE BDF转换INP
 * @date 2024-06-18 16:18
 */
public class CaeBdfToInpConverter implements ConversionStrategy {
    @Override
    public boolean convert(String inputFilePath) {
        String logUrl = FileUtils.changeFileExtension(inputFilePath, "log");
        String outputFilePath = FileUtils.changeFileExtension(inputFilePath, "inp");
        try {
            File logFile = new File(logUrl);
            logFile.createNewFile();
            File outputFileFile = new File(outputFilePath);
            outputFileFile.createNewFile();
            return true;
        } catch (IOException e) {
            return false;
        }
    }
}
